package com.lenovo.spider.queue;

import com.lenovo.spider.domain.Request;

/**
 * @author <a href="mailto:liuhan3@lenovo.com">HanL(liuhan3)</a>
 * on 2018/3/27 14:47
 */
public interface TaskQueue {

    /**
     * 从队列中获取请求
     *
     * @param key
     * @return
     */
    Request poll(String key);

    /**
     * 将请求压入队列
     *
     * @param key
     * @param requests
     */
    void push(String key, Request... requests);
}
